package org.dtrd.modules.food.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.food.entity.bean.FoodDetail;

import java.util.Date;


/**
 * <p>
 * 食材库
 * </p>
 *
 * @author QR
 * @since 2021-12-08
 */
@Getter
@Setter
@TableName("dtrd_ext_ems_yw_foods")
public class DtrdExtEmsYwFoods {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    /**
     * EMS食材表
     */
    @TableField("food_categoryId")
    private Integer foodCategoryid;

    /**
     * 食材名称
     */
    @TableField("food_name")
    private String foodName;

    /**
     * 重量（克）
     */
    @TableField("food_weight")
    private Float foodWeight;

    /**
     * 血糖生成指数
     */
    @TableField("food_gi")
    private Float foodGi;

    /**
     * 热量（kcal）
     */
    @TableField("food_kcal")
    private Float foodKcal;

    /**
     * 蛋白质（克）
     */
    @TableField("food_protein")
    private Float foodProtein;

    /**
     * 脂肪（克）
     */
    @TableField("food_fat")
    private Float foodFat;

    /**
     * 碳水化合物（克）
     */
    @TableField("food_cho")
    private Float foodCho;

    /**
     * 营养价值
     */
    @TableField("food_nutrient")
    private String foodNutrient;

    /**
     * 抗糖贴士
     */
    @TableField("food_sugar_tip")
    private String foodSugarTip;

    /**
     * 对并发症的益处
     */
    @TableField("food_complication_good")
    private String foodComplicationGood;

    /**
     * 创建时间
     */
    @TableField("food_create_time")
    private Date foodCreateTime;

    /**
     * 食材标签
     */
    @TableField("food_tips")
    private String foodTips;

    /**
     * 创建人
     */
    @TableField("food_creater")
    private String foodCreater;

    /**
     * 最后编辑人
     */
    @TableField("food_editor")
    private String foodEditor;

    /**
     * 最后编辑时间
     */
    @TableField("food_edit_time")
    private Date foodEditTime;

    /**
     * 删除人
     */
    @TableField("food_deleter")
    private String foodDeleter;

    /**
     * 删除时间
     */
    @TableField("food_del_time")
    private Date foodDelTime;

    /**
     * 食材URL
     */
    @TableField("food_url")
    private String foodUrl;

    /**
     * 食材图片
     */
    @TableField("food_thumb")
    private String foodThumb;

    /**
     * 水分
     */
    @TableField("food_water")
    private Float foodWater;

    /**
     * 维生素A
     */
    @TableField("food_vitamin_a")
    private Float foodVitaminA;

    /**
     * 维生素B1
     */
    @TableField("food_vitamin_b1")
    private Float foodVitaminB1;

    /**
     * 维生素B2
     */
    @TableField("food_vitamin_b2")
    private Float foodVitaminB2;

    /**
     * 维生素C
     */
    @TableField("food_vitamin_c")
    private Float foodVitaminC;

    /**
     * 维生素E
     */
    @TableField("food_vitamin_e")
    private Float foodVitaminE;

    /**
     * 烟酸
     */
    @TableField("food_niacin")
    private Float foodNiacin;

    /**
     * 钠
     */
    @TableField("food_sodium")
    private Float foodSodium;

    /**
     * 钙
     */
    @TableField("food_calsium")
    private Float foodCalsium;

    /**
     * 铁
     */
    @TableField("food_iron")
    private Float foodIron;

    /**
     * 胆固醇
     */
    @TableField("food_cholesterol")
    private Float foodCholesterol;

    /**
     * 膳食纤维
     */
    @TableField("food_dietary_fiber")
    private Float foodDietaryFiber;

    /**
     * 来源ID
     */
    @TableField("food_source_id")
    private Float foodSourceId;

    /**
     * 来源ID2017
     */
    @TableField("food_source_id2")
    private Float foodSourceId2;

    /**
     * 食材属性 0不显示  1 适宜 2 适量吃  3  宜不吃  
     */
    @TableField("food_propertity")
    private Integer foodPropertity;

    /**
     * 食材常见指数
     */
    @TableField("food_popular_index")
    private Integer foodPopularIndex;

    /**
     * 常见类型（可多选）：1-早餐,2-午餐,3-晚餐
     */
    @TableField("food_common_type")
    private String foodCommonType;

    public DtrdExtEmsYwFoods init() {
        isDel = 0;
        foodCreateTime = new Date();
        return this;
    }

    public DtrdExtEmsYwFoods parseFromDto(FoodDetail dto) {
        dataId = dto.getDataId();
        foodCategoryid = dto.getFoodCategoryid();
        foodName = dto.getFoodName();
        foodWeight = dto.getFoodWeight();
        foodGi = dto.getFoodGi();
        foodKcal = dto.getFoodKcal();
        foodProtein = dto.getFoodProtein();
        foodFat = dto.getFoodFat();
        foodCho = dto.getFoodCho();
        foodNutrient = dto.getFoodNutrient();
        foodSugarTip = dto.getFoodSugarTip();
        foodComplicationGood = dto.getFoodComplicationGood();
        foodTips = dto.getFoodTips();
        foodUrl = dto.getFoodUrl();
        foodThumb = dto.getFoodThumb();
        foodWater = dto.getFoodWater();
        foodVitaminA = dto.getFoodVitaminA();
        foodVitaminB1 = dto.getFoodVitaminB1();
        foodVitaminB2 = dto.getFoodVitaminB2();
        foodVitaminC = dto.getFoodVitaminC();
        foodVitaminE = dto.getFoodVitaminE();
        foodNiacin = dto.getFoodNiacin();
        foodSodium = dto.getFoodSodium();
        foodCalsium = dto.getFoodCalsium();
        foodIron = dto.getFoodIron();
        foodCholesterol = dto.getFoodCholesterol();
        foodDietaryFiber = dto.getFoodDietaryFiber();
        foodSourceId = dto.getFoodSourceId();
        foodSourceId2 = dto.getFoodSourceId2();
        foodPropertity = dto.getFoodPropertity();
        foodPopularIndex = dto.getFoodPopularIndex();
        foodCommonType = dto.getFoodCommonType();
        return this;
    }


}
